<!DOCTYPE HTML>
<html><head>
  <meta charset="utf-8">
  <title>Reference: line names in orthogonal parent subgrid</title>
  <link rel="author" title="Kurt Catti-Schmidt" href="mailto:kschmi@microsoft.com">
  <style>
    body {
      font:10px monospace; padding:0; margin:0; line-height:0;
    }

    .grid {
      display: inline-grid;
      grid-auto-columns: 15px;
      border: 1px solid;
      vertical-align: bottom;
    }

    .subgrid {
      display: grid;
      grid-template-columns: subgrid;
      grid-column: 3 / span 4;
      background: grey;
    }
    .grid > .subgrid > .subgrid {
      writing-mode: vertical-lr;
      grid-template-rows: subgrid;
      grid-template-columns: initial;
      grid-column: 1 / span 4;
      grid-auto-columns: 8px;
      grid-auto-flow: column;
    }

    .fill-1a  { grid-template-columns: subgrid repeat(auto-fill, [y]) [z] [z] [z] [z] }  /* [y] [z] [z] [z] [z] */
    .fill-1b  { grid-template-columns: subgrid [x] repeat(auto-fill, [y]) [z] [z] [z] }  /* [x] [y] [z] [z] [z] */
    .fill-1c  { grid-template-columns: subgrid [x] [x] repeat(auto-fill, [y]) [z] [z] }  /* [x] [x] [y] [z] [z] */
    .fill-1d  { grid-template-columns: subgrid [x] [x] [x] repeat(auto-fill, [y]) [z] }  /* [x] [x] [x] [y] [z] */
    .fill-1e  { grid-template-columns: subgrid [x] [x] [x] [x] repeat(auto-fill, [y]) }  /* [x] [x] [x] [x] [y] */

    .areas-1a { grid-template-areas: 'x x x x' }
    .areas-1b { grid-template-areas: '. x x x' }
    .areas-1c { grid-template-areas: 'x x x .' }
    .areas-1d { grid-template-areas: '. . x x' }
    .areas-1e { grid-template-areas: '. . x .' }

    .subgrid > .subgrid > :nth-child(2n)   {  background: black; }
    .subgrid > .subgrid > :nth-child(2n+1) {  background: pink; }
    .subgrid > .subgrid > * { writing-mode: horizontal-tb; }

    </style>
  </head>
  <body>

  <!-- Line names before/after auto repeat -->
  <div class="grid"><div class="subgrid fill-1a"><div class="subgrid">
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:3"></div>
    <div style="grid-row:2"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:3"></div>
    <div style="grid-row:2"></div>
    <div style="grid-row:1"></div>
  </div></div></div>

  <div class="grid"><div class="subgrid fill-1b"><div class="subgrid">
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
  </div></div></div>

  <div class="grid"><div class="subgrid fill-1c"><div class="subgrid">
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:2"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:2"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
  </div></div></div>

  <div class="grid"><div class="subgrid fill-1d"><div class="subgrid">
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:3"></div>
    <div style="grid-row:2"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:3"></div>
    <div style="grid-row:2"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
  </div></div></div>

  <div class="grid"><div class="subgrid fill-1e"><div class="subgrid">
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:3"></div>
    <div style="grid-row:2"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:3"></div>
    <div style="grid-row:2"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
  </div></div></div>

  <div class="grid"><div class="subgrid fill-1a"><div class="subgrid">
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
  </div></div></div>

  <!-- Auto repeat line names -->
  <div class="grid"><div class="subgrid fill-1b"><div class="subgrid">
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:2"></div>
    <div style="grid-row:2"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
  </div></div></div>

  <div class="grid"><div class="subgrid fill-1c"><div class="subgrid">
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:3"></div>
    <div style="grid-row:3"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
  </div></div></div>

  <div class="grid"><div class="subgrid fill-1d"><div class="subgrid">
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
  </div></div></div>

  <div class="grid"><div class="subgrid fill-1e"><div class="subgrid">
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
  </div></div></div>

  <div class="grid"><div class="subgrid fill-1a"><div class="subgrid">
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:3"></div>
    <div style="grid-row:2"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:3"></div>
    <div style="grid-row:2"></div>
    <div style="grid-row:1"></div>
  </div></div></div>

  <div class="grid"><div class="subgrid fill-1b"><div class="subgrid">
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:3"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:3"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
  </div></div></div>

  <div class="grid"><div class="subgrid fill-1c"><div class="subgrid">
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
  </div></div></div>

  <div class="grid"><div class="subgrid fill-1d"><div class="subgrid">
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
  </div></div></div>

  <div class="grid"><div class="subgrid fill-1e"><div class="subgrid">
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:4"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
    <div style="grid-row:1"></div>
  </div></div></div>

  <!-- Named grid areas -->
  <div class="grid"><div class="subgrid areas-1a"><div class="subgrid">
    <div style="grid-row:1"></div>
    <div style="grid-row:1 / -1"></div>
    <div style="grid-row:1 / -1"></div>
    <div style="grid-row:-1"></div>
  </div></div></div>

  <div class="grid"><div class="subgrid areas-1b"><div class="subgrid">
    <div style="grid-row:2"></div>
    <div style="grid-row:2 / -1"></div>
    <div style="grid-row:2 / -1"></div>
    <div style="grid-row:-1"></div>
  </div></div></div>

  <div class="grid"><div class="subgrid areas-1c"><div class="subgrid">
    <div style="grid-row:1"></div>
    <div style="grid-row:1/-2"></div>
    <div style="grid-row:1/-2"></div>
    <div style="grid-row:-2"></div>
  </div></div></div>

  <div class="grid"><div class="subgrid areas-1d"><div class="subgrid">
    <div style="grid-row:3"></div>
    <div style="grid-row:3 / -1"></div>
    <div style="grid-row:3 / -1"></div>
    <div style="grid-row:-1"></div>
  </div></div></div>

  <div class="grid"><div class="subgrid areas-1e"><div class="subgrid">
    <div style="grid-row:3"></div>
    <div style="grid-row:3"></div>
    <div style="grid-row:3"></div>
    <div style="grid-row:-1"></div>
  </div></div></div>
  </body>
  </html>
